home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / dbase / vpi1_330.zip / DATES.PRG < prev    next >
Text File  |  1991-12-30  |  2KB  |  61 lines

  1. ***************************************************************************
  2. **  DATES.PRG
  3. **  (C) Copyright 1990-92, Sub Rosa Publishing Inc.
  4. **
  5. **  A demonstration program provided to VP-Info users.
  6. **  This program may be copied freely. If it is used in commercial code,
  7. **  please credit the source, Sub Rosa Publishing Inc.
  8. **
  9. **  DATES demonstrates the use of DATE() and the DAYS() functions
  10. **  to generate a wide variety of formated outputs and other information.
  11. **  DATES is compatible with all current versions of VP-Info.
  12. **
  13. **  Sid Bursten and Bernie Melman
  14. ***************************************************************************
  15. SET raw off
  16. SET date to 'MMDDYYYY'
  17. IF :color <> 7
  18.    SET color to 31; white on blue
  19. ENDIF
  20. *
  21. WINDOW ; set window to full screen
  22. ERASE  ; clear screen
  23. ? "Today's date in the default format is: ", date(7)
  24. ? "Today's date in format #1 is: ", date(1)
  25. ? "Today's date in format #2 is: ", date(2)
  26. ? "Today's date in format #3 is: ", date(3)
  27. ? "Today's date in format #4 is: ", date(4)
  28. ? "Today's date in format #5 is: ", date(5)
  29. ? "Today's date in format #6 is: ", date(6)
  30. ? "Today's date in format #8 is: ", date(8)
  31. ? "Today's date in format #9 is: ", date(9)
  32. ? "ONLY ",days(date(7),'01012000'),' days left in the 20th century'
  33. *
  34. ?
  35. string=blank(8)
  36. DO WHILE t
  37.    ? 'Enter a legal date in format MMDDYYYY'
  38.    ACCEPT 'Enter 01011900 to quit.... ' TO string
  39.    IF string='01011900'
  40.       BREAK
  41.    ENDIF
  42.    IF date(1,string)<>' ' ; a blank return means an illegal date
  43.       ? "Selected date in format #1 is: ", date(1,string)
  44.       ? "Selected date in format #2 is: ", date(2,string)
  45.       ? "Selected date in format #3 is: ", date(3,string)
  46.       ? "Selected date in format #4 is: ", date(4,string)
  47.       ? "Selected date in format #5 is: ", date(5,string)
  48.       ? "Selected date in format #6 is: ", date(6,string)
  49.       ? "Selected date in format #8 is: ", date(8,string)
  50.       ? "Selected date in format #9 is: ", date(9,string)
  51.       ? "Number of days to Christmas, 2001 is:"
  52.       ?? pic(days(string,"12/25/2001"),'999,999')
  53. * note extra characters in date string above are ignored
  54.    ELSE
  55.       ? "ILLEGAL DATE - please be more careful."
  56.    ENDIF
  57. ENDDO
  58. CHAIN samples
  59. *
  60. *                        *** end of DATES.PRG ***
  61.